URL Parameterization

When you directly access a discovery using its URL, you can filter its content by adding one or more filter parameters to the URL's query string. This effectively adds a background filter to your visual at runtime.

Using a Direct URL

You can copy the Direct URL for an item to your clipboard, and then paste it into your browser or share it with others. The Direct URL link is available from an item's App Tabs menu, Metadata panel, or from its Actions panel in Content Explorer. For more information, see Direct Load (via URL).

Using the Filter Query String

Filter by Color

You can add filters to the item as parameters appended to the URL's query string, using the following syntax:

&filter=[products].[color].[black]

Filter by Color and Gender

You can add multiple filters to the URL's query string - in this example, the following filters were added:

&filter=[products].[color].[black]&filter=[customerProfile].[Gender].[Male]

Filter using PQL

You can construct a PQL expression and add it to your &filter. The following example initializes the visual for the date range from 01-Dec-2009 to 31-Dec-2010:

&filter=%7B[data].[dateKey]:SET:%7BRANGE(DateSelection([data].[dateKey],"2009-12-01",5),DateSelection([data].[dateKey],"2010-12-31",5))%7D%7D

About the expression:

  • This expression is setting the date RANGE.
  • The start and end dates in the range are each selected from the model using the DateSelection function, which gets each date from the dateKey hierarchy.
  • The {braces} are escaped using the standard %7B and %7D escape characters.

When the discovery is launched in the Viewer (using a URL), it is filtered to include data from the specified date range. You can see the effect of the filter on the x-axes (orange highlight above).